<template>
  <div
    class="doctor_cell"
    :class="size ? 'doctor_cell_' + size : ''"
  >
    <div class="score">
      <img src="@/assets/images/home/star.png" alt="" />
      <span>{{ $fomartRate(info.initScore) }}分</span>
    </div>
    <div class="image_box">
      <nuxt-link :to="`/doctor/${info.id}`" v-if="!url">
        <li-image :src="info.logo" class="img" v-if="info.logo" :alt="`${info.name}口腔医生执业资格`" />
        <TextLogo v-else-if="info.textLogo" :name="info.textLogo" />
        <img src="@/assets/images/avatar/doctor_circle.png" class="img" :alt="`${info.name}口腔医生执业资格`" v-else />
      </nuxt-link>
      <nuxt-link :to="`${url}/${info.id}`" v-else>
        <li-image :src="info.logo" class="img" v-if="info.logo" :alt="`${info.name}口腔医生执业资格`" />
        <TextLogo v-else-if="info.textLogo" :name="info.textLogo" />
        <img src="@/assets/images/avatar/doctor_circle.png" class="img" :alt="`${info.name}口腔医生执业资格`" v-else />
      </nuxt-link>
      <img src="@/assets/images/home/rz.png" class="rz" alt="" />
    </div>
    <div class="title">
      <nuxt-link :to="`/doctor/${info.id}`" v-if="!url">{{ info.name }}</nuxt-link>
      <nuxt-link :to="`${url}/${info.id}`" v-else>{{ info.name }}</nuxt-link>
    </div>
    <div class="post">{{ info.personalTitle }}</div>
    <div class="desc">
      {{ info.introduce }}
    </div>
    <div class="book">预约{{ info.initAppointmentCnt }}人</div>
  </div>
</template>
<script>
import TextLogo from '@/components/logo/index.vue'
export default {
  name: "Doctor",
  components:{
    TextLogo
  },
  props: {
    info: {
      type: Object,
      default: function () {
        return {};
      },
    },
    size: {
      type: String, // small
      default: "",
    },
    url: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    // 查看详情
    lookDetail() {
      let url = this.url;
      let o = this.info;
      // let query = this.$route.query;
      // query.id = o.id
      this.$routerPush(url, { id: o.id });
      // this.$router.push({
      //     path: url,
      //     query: { ...query }
      // })
    },
  },
};
</script>
<style lang="less" scoped>
@import "./index.less";
</style>